#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

DEB_HOST_GNU_TYPE?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
CC=$(DEB_HOST_GNU_TYPE)-gcc
export CC

%:
	dh $@ 

build: 
	dh_testdir
	dh_auto_configure

	$(MAKE) -C src

	dh_auto_test

override_dh_auto_install:
	install -d debian/robocfg/usr/sbin
	install src/robocfg debian/robocfg/usr/sbin/robocfg

# Do not restart service on upgrade and only start in S
# update-rc.d robocfg start 38 S .
override_dh_installinit:
	dh_installinit --no-start -r -u"start 38 S ."

override_dh_auto_clean:
	rm -f src/robocfg src/*.o
